default_platform(:ios)

platform :ios do

  desc "Release a new version with a patch bump_type"
  lane :patch do
    release("patch")
  end

  desc "Release a new version with a minor bump_type"
  lane :minor do 
    release("minor")
  end 

  desc "Release a new version with a major bump_type"
  lane :major do 
    release("major")
  end 

  def release(type)
    pod_lib_lint
    podspec_name = "EasyTransitions.podspec"
    version = version_bump_podspec(path: podspec_name, 
                                   bump_type: type)
    cocoapods(podfile: "./Example")
    git_add
    git_commit(path: ".",
               message: "#{version} release")
    add_git_tag(tag: "#{version}")
    push_to_git_remote
    pod_push
  end
end
